home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / misc1 / mew10.zip / EMACS.RC < prev    next >
Text File  |  1992-04-17  |  5KB  |  160 lines

  1. ;    Startup program for Micro-EMACS 3.11c for Windows (update 1.0)
  2. ;
  3. ; Pierr Perret - April 1992
  4.  
  5. set $discmd FALSE
  6. write-message "[Setting up....]"
  7.  
  8. !if &seq $sres "MSWIN"
  9. ; running under MS Windows
  10.  
  11. ; setup some cool colors
  12.     add-mode lcyan          ; background
  13.     add-global-mode lcyan
  14.     add-mode BLACK          ; foreground
  15.     add-global-mode BLACK
  16.  
  17. ; resize the screen for 100 columns
  18.     100  change-screen-width
  19.  
  20. ; this macro calls up the SDK help on the curent topic
  21. ; note that it modifies mark0 and mark7
  22.     store-procedure Win-API-Help
  23.         7   set-mark
  24.         forward-character
  25.         !force previous-word
  26.         0   set-mark
  27.         end-of-word
  28.         set %Keyword $region
  29.         7   goto-mark
  30.         !if &sequal %Keyword &upper %Keyword
  31.             ; keyword is all uppercase
  32.             set %tmp &sindex %Keyword "_"
  33.             !if ¬ &equal %tmp 0
  34.                 ; there is an underscore in there...
  35.                 !if &or &equal %tmp 3 &sequal &mid %Keyword 2 3 "BN_"
  36.                     ; the underscore is the 3rd character or
  37.                     ; the second to 4th characters are "BN_"
  38.                     set %KeywordType " message"
  39.                 !else
  40.                     set %tmp 0
  41.                 !endif
  42.             !endif
  43.             !if &equal %tmp 0
  44. *GetAdvice
  45.                 write-message "What is it ? (S=data Structure, M=utility Macro, P=Printer escape)"
  46.                 set %tmp &upper >k
  47.                 !if &equal &sindex "SMP" %tmp 
  48.                     !goto GetAdvice
  49.                 !endif
  50.                 !if &sequal %tmp "S"
  51.                     set %KeywordType " data structure"
  52.                 !else
  53.                     !if &sequal %tmp "M"
  54.                         set %KeywordType " utility macro"
  55.                     !else
  56.                         set %KeywordType " printer escape"
  57.                     !endif
  58.                 !endif
  59.             !endif
  60.         !else
  61.         ; keyword contains lower case characters
  62.             set %KeywordType " function"
  63.         !endif
  64.         write-message &cat "Looking for: " &cat %Keyword %KeywordType
  65.         help-engine "SDKWIN.HLP" &cat %Keyword %KeywordType
  66.     !endm
  67.  
  68. ; this macro calls up the TCW help on the curent topic
  69. ; note that it modifies mark0 and mark7
  70.     store-procedure TCW-Help
  71.         7   set-mark
  72.         forward-character
  73.         !force previous-word
  74.         0   set-mark
  75.         end-of-word
  76.         set %Keyword $region
  77.         7   goto-mark
  78.         write-message &cat "Looking for: " &cat %Keyword
  79.         help-engine "TCWHELP.HLP" &cat %Keyword
  80.     !endm
  81.  
  82. ; this macro allows easy resizing of the current screen
  83.     store-procedure Set-Screen-Size
  84.         set %tmp @&cat &cat "Screen width (" $curwidth "): "
  85.         !if ¬ &sequal %tmp ""
  86.             set $curwidth %tmp
  87.         !endif
  88.         set %tmp @&cat &cat "Screen height (" $pagelen "): "
  89.         !if ¬ &sequal %tmp ""
  90.             set $pagelen %tmp
  91.         !endif
  92.     !endm
  93.  
  94. ; this macro allows easy setting of the fill column
  95.     store-procedure  Set-Fill-Column
  96.         set %tmp @&cat &cat "Fill column (" $fillcol "): "
  97.         !if ¬ &sequal %tmp ""
  98.             set $fillcol %tmp
  99.         !endif
  100.     !endm
  101.  
  102. ; create/modify a few menu entries
  103. ;
  104. ; add the SDK help menu items at position 5 in the Help menu
  105. ; ("@" positions start at 0)
  106.     macro-to-menu   Win-API-Help    ">&Help>&Windows API@5"
  107.     macro-to-menu   TCW-Help        "&Turbo C++ help"
  108. ; follow by a separator (note that nop is used as a placeholder)
  109.     bind-to-menu    nop             "-"
  110. ; get rid of some menu entries
  111. ; to replace them by a nicer macro that actually prompts the user
  112.     unbind-menu     ">S&creen>Si&ze>= &Width"
  113.     unbind-menu     "= &Height"
  114.     macro-to-menu   Set-Screen-Size "&Set:"
  115.     unbind-menu     ">&Edit>= &Fill column"
  116.     macro-to-menu   Set-Fill-Column "&Fill column:"
  117.  
  118.     write-message "[Loading MDI macros...]"
  119.     execute-file "mdi.cmd"
  120. !endif
  121. ; end of the MS-Windows stuff
  122.  
  123. !if &seq &left $version 4 "3.11"
  124.     write-message "[Loading CUA-feel macros...]"
  125.     execute-file "cua.cmd"
  126.     write-message "[Still setting up...]"
  127. !endif
  128.  
  129. store-procedure    extension
  130. ; figure out the filename extension. returns lowercase result in %ext
  131. ; if no extension, returns ""
  132.     set %tmp &rig $cfname 4
  133.     set %ext &sin %tmp "."
  134.     !if &equ %ext 0
  135.         set %ext ""
  136.     !else
  137.         set %ext &low &mid %tmp &add %ext 1 3
  138.     !endif
  139. !endm
  140.  
  141. store-procedure readhook-proc
  142.     run extension
  143.     !if &sin "|c|h|cpp|hpp|dlg|def|rc|cmd|" &cat &cat "|" %ext "|"
  144.         add-mode cmode
  145.     !else
  146.         !if &sin "||me|1st|doc|txt|" &cat &cat "|" %ext "|"
  147.             add-mode wrap
  148.         !endif
  149.     !endif
  150. !endm
  151. set $readhook readhook-proc
  152.  
  153. set $ssave FALSE
  154. 4    handle-tab
  155. bind-to-key end-of-word M-F     ; I personally prefer this over next-word
  156. bind-to-key end-of-word FN^F
  157.  
  158. clear-message-line
  159. set $discmd TRUE
  160.